$(document).ready(function() {
	removeAllScreen();
	$('#customer-entry').addClass('active'); // Assign customer-entry.screen as default active Screen
	$('#customer-entry.screen.active').show("slow"); //Show the entry-screen.
	$("input[type='date']").now();
});

var removeAllScreen = function() {
	var entity = ["transaction","customer","product","lender"];
	var i;
	// Remove all entry screen as active and hide all
	for (i=0;i<entity.length;i++) { 
		$('#'+entity[i]+'-entry').removeClass('active');
		$('#'+entity[i]+'-entry').hide();
	}
}

var showScreen = function() {
	var entity = $("select.entry-screen").val();
	removeAllScreen();
	$('#'+entity+'-entry').addClass('active');
	$('#'+entity+'-entry').show("slow");
}

var transactionChange = function() {
	var transactionOption = $("#transactionOption").val();
	if(transactionOption=="new") {
		$("#transactionNo").show("slow");
	} else {
		$("#transactionNo").hide("slow");
	}
}